package edu.gyc.test;

import java.util.concurrent.atomic.AtomicInteger;

public class Casdemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(6);
        System.out.println(atomicInteger.compareAndSet(6,2020)+"\t current value: "+atomicInteger.get());
        System.out.println(atomicInteger.compareAndSet(6,1949)+"\t current value: "+atomicInteger.get());
    }
}
